package com.mayun.jpa.controller;

import com.mayun.jpa.entity.UserEntity;
import com.mayun.jpa.mapper.UserMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/jpa")
@Slf4j
public class UserController {

    @Autowired
    UserMapper userMapper;

    @GetMapping(value = "/getUser")
    public void getUser(int id){
        UserEntity userEntity = userMapper.getOne(id);
        log.info(userEntity.toString());
    }
}
